package com.hbnu.test.www.Equals;

public class ET01 {
    private int age;
    private String name;
//    public ET01(int age) {
//        this.age = age;
//    }

//    public ET01(int age) {
//        this.age = age;
//    }


    public boolean equalsaa(Object obj) {
        //判断是否为空
        if (obj == null) {
            return false;
        }
        //是否为同一地址
        if (this == obj) {
            return true;
        }
        //是否为同一类型
        if (this.getClass() != obj.getClass()) {
            return false;
        }
        //创建对象进行比较
        ET01 et = (ET01) obj;
        return et.getName().equals(getName());
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
